package com.zlq.sen;


import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;

@Component
public class HelloSen {
    @Resource
    private AmqpTemplate rabbitTemplate;

    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
    public void send(){
        rabbitTemplate.convertAndSend("hello","吱吱吱");
        System.out.println("现在时间"+dateFormat.format(new Date()));
    }
}
